package com.grouplay.service;

import com.grouplay.entity.Group;
import com.grouplay.entity.GroupBudget;
import com.grouplay.entity.User;

import java.util.List;

//接口类
public interface IGroupService {

    boolean createGroup(User user, Group group);

    /**
     * 按照创建者查找所有他创建的团队
     * @param leaderId
     * @return
     */
    List<Group> findAllGroupsByLeaderId(Integer leaderId);

    /**
     * 按照创建者查找所有他创建的未结束团队
     * @param leaderId
     * @return
     */
    List<Group> findNotEndGroupsByLeaderId(Integer leaderId);

    /**
     * 按照创建者查找所有他创建的已结束团队
     * @param leaderId
     * @return
     */
    List<Group> findIsEndGroupsByLeaderId(Integer leaderId);

    /**
     * 查找一个团队除了团长之外的其他用户
     * @param groupId
     * @param leaderId
     * @return
     */
    List<User> findAllUserNameOfTheGroupByGroupWhileIsNotEnd(Integer groupId, Integer leaderId);

    boolean sendOneInvitation(Integer groupId, String targetName, Integer leaderId);

    Group findGroupByGroupIdAndUid(Integer groupId, Integer uid);

    boolean joinInGroupByGroupIdAndUid(Integer groupId, Integer uid);

    boolean updateGroupBudget(Group group);

    List<Group> findMyJoinGroupsByUid(Integer uid);

    boolean endGroup(Integer groupId, Integer leaderId);

    List<Group> findMyJoinGroupsIsEndAndIsNotPay(Integer uid);

    List<GroupBudget> findGroupBudgetByGroupId(Integer groupId, Integer uid);
}
